package com.lancoo.ccas52.mapper;
import java.util.Collection;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lancoo.ccas52.entity.Room;
import com.lancoo.ccas52.entity.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas52.config.MybatisRedisCache;
import com.lancoo.ccas52.pojo.dto.TeachingClassDto;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 教师 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2023-01-31
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface TeacherMapper extends BaseMapper<Teacher> {

    int addBatch(@Param("teacherCollection") Collection<Teacher> teacherCollection);


    /**
     * 根据教学班id获取其教师信息
     * @param teachingClassIds
     * @return
     */
    @Deprecated
    List<Teacher> getTeacherByTeachingClassIds(@Param("teachingClassIds") List<Long> teachingClassIds);

    /**
     * 根据教师id获取其教学班信息
     * @param teacherIds
     * @return
     */
    List<TeachingClassDto> getTeachingClassByTeacherId(@Param("teacherIds") List<Long> teacherIds);

    /**
     * 获取教师列表 关联教师禁排信息
     * @param page
     * @param schoolId
     * @param term
     * @param collegeId
     * @param keyword
     * @param state
     * @return
     */
    IPage<Teacher> getRuleTeacher(@Param("page") IPage page, @Param("schoolId") String schoolId, @Param("term") String term,
                            @Param("collegeId") String collegeId, @Param("keyword") String keyword, @Param("state") Integer state);

}
